// test git add -A :/
#include <stdio.h>
#include <unistd.h>
#include <signal.h>
#include <stdlib.h>
#include <string.h>

struct sigaction act, oact;
void handler(int signo)
{
  printf("catch a signal : %d\n",signo);
  sigaction(SIGINT, &oact, NULL);
}

int main()
{
  memset(&act, 0, sizeof(act));
  memset(&oact, 0, sizeof(oact));
  
  act.sa_handler = handler; 
  act.sa_flags = 0;
  sigemptyset(&act.sa_mask);

  //signal(2,handler);
  sigaction(SIGINT, &act, &oact);
  while(1){
   printf("hello ... \n");
   sleep(1);
  }

//
//  while(1){
//    sleep(1);
//    raise(2);
//  }
  //kill(atoi(argv[[1]]),atoi(argv[2]))
   //signal(2,handler);
   //}
    return 0;
}
